package nowCoder;

public class JumpFloor {
	public int JumpFloor(int target) {
		if (target == 0 || target == 1)
			return 1;
		int[] w = new int[target + 1];
		w[0] = 1;
		w[1] = 1;
		for (int i = 2; i < w.length; i++) {
			w[i] = w[i - 1] + w[i - 2];
		}
		return w[target];
	}

	public int JumpFloorII(int target) {
		if (target == 0 || target == 1)
			return 1;
		int[] w = new int[target + 1];
		w[0] = 1;
		w[1] = 1;
		for (int i = 2; i < w.length; i++) {
//			w[i]=0;
//			for(int j=i-1;j>=0;j--)
//				w[i]+=w[j];
			w[i] = w[i-1]<<1;
		}
		return w[target];
	}

	public static void main(String[] args) {
		JumpFloor jumpFloor = new JumpFloor();
		System.out.println(jumpFloor.JumpFloorII(30));
	}
}
